//
//  BSRecommendViewModel.m
//  sister
//
//  Created by 周冰烽 on 2017/2/16.
//  Copyright © 2017年 周冰烽. All rights reserved.
//

#import "BSRecommendViewModel.h"

@implementation BSRecommendViewModel
-(NSInteger)rowNumber{
    return self.recommendList.count;
}
-(NSString *)headerImageName:(NSInteger)index{
    return self.recommendList[index].header;
}
-(NSString *)ID:(NSInteger)index{
    return self.recommendList[index].ID;
}
-(NSInteger)tieziCount:(NSInteger)index{
    return self.recommendList[index].tieziCount;
}
-(NSString *)uid:(NSInteger)index{
    return self.recommendList[index].uid;
}
-(NSString *)introduction:(NSInteger)index{
    return self.recommendList[index].introduction;
}
-(NSString *)fansCount:(NSInteger)index{
    return self.recommendList[index].fansCount;
}
-(NSInteger)isFollow:(NSInteger)index{
    return self.recommendList[index].isFollow;
}
-(NSString *)socialName:(NSInteger)index{
    return self.recommendList[index].socialName;
}
-(NSInteger)platFalg:(NSInteger)index{
    return self.recommendList[index].platFlag;
}
-(BOOL)isVip:(NSInteger)index{
    return self.recommendList[index].isVip;
}
-(NSString *)screenName:(NSInteger)index{
    return self.recommendList[index].screenName;
}
-(NSString *)gender:(NSInteger)index{
    return self.recommendList[index].gender;
}

-(NSMutableArray<RecommendData *> *)recommendList{
    if (!_recommendList) {
        _recommendList = [NSMutableArray<RecommendData *> new];
    }
    return _recommendList;
}
-(void)getRecommendDataWithA:(NSString *)a C:(NSString *)c completionHandler:(void (^)(NSError *))completionHandler{
    [BSNetManager recommendDataWithA:a c:c completionHandler:^(BSRecommendModel *model, NSError *error) {
        [self.recommendList removeAllObjects];
        [self.recommendList addObjectsFromArray:model.topList];
        completionHandler(error);
    }];
}
@end
